package com.tgy.files.controller;

import com.tgy.files.service.impl.HtmlService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 生成html静态页面
 * @author tianguiyin
 * @version 1.0
 * @date 2022/7/7 19:27
 */
@RestController
@RequestMapping("/html")
public class HtmlController {
    final static Logger logger = LoggerFactory.getLogger(HtmlController.class);

    @Resource
    private HtmlService htmlService;

    @GetMapping("/download")
    @ApiOperation(value = "下载html", notes = "下载html", httpMethod = "GET")
    public Integer download(String articleId, String articleMongoId)
            throws Exception {
        return htmlService.download(articleId,articleMongoId);
    }

    @GetMapping("/delete")
    @ApiOperation(value = "删除html", notes = "删除html", httpMethod = "GET")
    public Integer delete(String articleId,String articleMongoId) throws Exception {
        return htmlService.delete(articleId,articleMongoId);
    }

}
